<template>
  <section class="todoapp">
    <!-- 除了驼峰, 还可以使用-转换链接 -->
   <TodoHeader/>
   <TodoMain/>
   <TodoFooter/>
    
  </section>
</template>

<script>
import TodoHeader from "./components/TodoHeader";
import TodoMain from "./components/TodoMain";
import TodoFooter from "./components/TodoFooter";

import "./style/base.css"
import "./style/index.css"
export default {
  data() {
    return {
      watchList : this.$store.state.list
    }
  },
  components: {
    TodoHeader,
    TodoMain,
    TodoFooter,
  },
  watch :{
    watchList : {
      deep : true,
      handler() {
        localStorage.setItem('todo',JSON.stringify(this.watchList))
      }
    }
  }
  }
</script>